﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ECCSystem.BizRule
{ 
    class ClsEntry
    {
        ClsCommon objCommon = new ClsCommon();
        DataAccess.ClsEntry objDAEntry = new ECCSystem.DataAccess.ClsEntry();
        public ClsEntry()
        { }

        public object GetList()
        {
            //get ECCDate for get today's data
            string strECCDate = objCommon.GetECCDate(DateTime.Now);
            strECCDate = strECCDate.Substring(0, 10);
            return objDAEntry.GetList(ClsCommon.gIntOperatorID,strECCDate);
        }


        public int AddEntry(int intMailCategoryID, string strMailSubject, string strSaleCommodityID,
            float fltOperationTime, float fltPauseTime, int intHoldCount, string strBizStatus)
        {
            string strECCDate = objCommon.GetECCDate(DateTime.Now);
            return objDAEntry.AddEntry(intMailCategoryID,strMailSubject,strSaleCommodityID,fltOperationTime,
                fltPauseTime,intHoldCount,strBizStatus,ClsCommon.gIntOperatorID,strECCDate);
        }

        public object GetEntry(int intBusinessID)
        {
            return objDAEntry.GetEntry(intBusinessID);
        }

        public int EditHoldEntry(int intMailCategoryID, string strMailSubject, string strSaleCommodityID,
            float fltOperationTime, float fltPauseTime, int intHoldCount, string strBizStatus,int intBusinessID)
        {
            string strECCDate = objCommon.GetECCDate(DateTime.Now);
            return objDAEntry.EditHoldEntry(intMailCategoryID, strMailSubject, strSaleCommodityID, fltOperationTime,
                fltPauseTime, intHoldCount, strBizStatus, ClsCommon.gIntOperatorID, strECCDate,intBusinessID);
        }
        public int EditEntry(int intMailCategoryID, string strMailSubject, string strSaleCommodityID,int intID)
        {
            return objDAEntry.EditEntry(intMailCategoryID, strMailSubject, strSaleCommodityID,intID);
        }


        public int DeleteEntry(int intBusinessID)
        {
            return objDAEntry.DeleteEntry(intBusinessID);
        }
    }
}
